import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { CenterRegulationComponent } from './center-regulation.component';
import { AreaViewComponent } from './area-view/area-view.component';
import { AreaCreateComponent } from './area-create/area-create.component';
import { PathCreateComponent } from './path-create/path-create.component';
import { PathManagementComponent } from './path-management/path-management.component';
import { ContainerDispatchComponent } from './container-dispatch/container-dispatch.component';
import { AlarmManagementComponent } from './alarm-management/alarm-management.component';
import { AppRouteGuard } from '@shared/common/auth/auth-route-app-guard';

const routes: Routes = [

  {
    path: '',
    canActivate: [AppRouteGuard],
    canActivateChild: [AppRouteGuard],
    component: CenterRegulationComponent,
    data: { breadcrumb_no_url: 'center_supervise' },
    children: [
      {
        path: 'area/areaView',
        component: AreaViewComponent,
        data: { permission: 'A8_B22_', activeMenu: 'area' , tabBelong: 'area', breadcrumb: 'area_manage'}
      },
      {
        path: 'area/areaCreate',
        component: AreaCreateComponent,
        data: { permission: 'A8_B22_', activeMenu: 'area' , tabBelong: 'area', breadcrumb: 'area_manage'}
      },

      {
        path: 'path/pathCreate',
        component: PathCreateComponent,
        data: { permission: 'A8_B23_', activeMenu: 'path', tabBelong: 'path', breadcrumb: 'bread_path_manage' }
      },
      {
        path: 'path/pathManagement',
        component: PathManagementComponent,
        data: { permission: 'A8_B23_', activeMenu: 'path', tabBelong: 'path', breadcrumb: 'path_manage' }
      },

      {
        path: 'containerDispatch',
        component: ContainerDispatchComponent,
        data: { permission: 'A8_B24_', activeMenu: 'containerDispatch', tabBelong: 'containerDispatch', breadcrumb: 'container_dispath_plan' }
      },

      {
        path: 'alarmManagement',
        component: AlarmManagementComponent,
        data: { permission: 'A8_B25_', activeMenu: 'alarmManagement', tabBelong: 'alarmManagement', breadcrumb: 'warn_manage' }
      },
    ],
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class CenterRegulationRoutingModule { }
